package com.starblink.mine.personhome.ui.follow.ui

import androidx.lifecycle.viewModelScope
import com.starblink.android.basic.base.BaseViewModel
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.launch

/**
 * Activity和Fragment之间共享搜索内容
 */
class SharedSearchViewModel : BaseViewModel() {
    val searchEventForFollowingList: MutableSharedFlow<String> = MutableSharedFlow ()
    val searchEventForFollowerList: MutableSharedFlow<String> = MutableSharedFlow ()

    fun sendSearchEventForFollowingList(content: String) {
        viewModelScope.launch {
            searchEventForFollowingList.emit(content)
        }
    }

    fun sendSearchEventForFollowerList(content: String) {
        viewModelScope.launch {
            searchEventForFollowerList.emit(content)
        }
    }
}